ans = 0

def ispal(n):
	if str(n) == str(n)[::-1]:
		return True
	else:
		return False
	
	
for x in range(100,999):
	for y in range(100,999):
		a = x*y
		if ispal(a) and a > ans:
			ans = a
			
print(ans)			